package com.yz.dao;

import com.yz.pojo.Department;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author yuanzheng
 * @date 2020/7/22-14:12
 */
@Repository
public class DepartmentDao {
    private static Map<Integer, Department> departments = null;

    static {
        departments = new HashMap<>();
        departments.put(100, new Department(100, "教学部"));
        departments.put(101, new Department(101, "后勤部"));
        departments.put(102, new Department(102, "研究部"));
        departments.put(103, new Department(103, "宣传部"));
    }

    public Collection<Department> getDepartment() {
        return departments.values();
    }

    public Department getDepartmentById(Integer id) {
        return departments.get(id);
    }

}